package com.bw.message.net

import androidx.lifecycle.MutableLiveData
import com.bw.message.model.MessageEntity
import com.bw.common.vm.BaseViewModel
import com.bw.http.utils.zgr.OkHttpClientManager
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class MessageViewModel @Inject constructor(
    private val apiService: ApiService
) :BaseViewModel() {

    val messageSuccess by lazy { MutableLiveData<List<MessageEntity>>() }

    fun getMessage(accessId: Int, userId: Int) {

        executeNetwork(
            { apiService.getMessage(accessId, userId) },
            messageSuccess::postValue
        )
    }

}